package com.example.demo.auth.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Entity
@Table(
        name = "V_IDM_USER"
)
public class UpUser {
    
	@Transient
    public Long getUserid() {
        return getNid();
    }
    @Transient
    public String getLoginName(){
        return getAccount();
    }
    
    /**
     * 本地id
     */
    private Long nid;
    /**
     * 统一认证中心id
     */
    private String id;
    /**
     *姓名
     */
    private String name;
    /**
     * 账号
     */
    private String account;
    /**
     * 描述
     */
    private String description;
    /**
     * 帐号是否启用
     */
    private String accountEnable;
    /**
     * 帐号是否锁定
     */
    private String accountLocked;
    /**
     * 帐号锁定原因
     */
    private String accountLockedReason;
    /**
     * 性别
     */
    private String sex;
    /**
     * 生日
     */
    private Date birthdate;
    /**
     * 证件类型
     */
    private String credentialsType;
    /**
     * 证件号码
     */
    private String credentialsNumber;
    /**
     * 邮件地址
     */
    private String email;
    /**
     * 移动电话
     */
    private String mobileTelephone;
    /**
     * 办公电话
     */
    private String officeTelephone;
    /**
     * 传真
     */
    private String fax;
    /**
     * 创建人
     */
    private String createdBy;
    /**
     * 创建时间
     */
    private Date creationDate;
    /**
     * 修改人
     */
    private String lastUpdatedBy;
    /**
     * 修改时间
     */
    private Date lastUpdateDate;
    /**
     * 使用状态
     */
    private String activeFlag;
    /**
     * 次序,排序专用
     */
    private Long orderNum;

    private UpUnitUser upUnitUser;

    @Id
    @Column(
            name = "NID"
    )
    public Long getNid() {
        return nid;
    }

    public void setNid(Long nid) {
        this.nid = nid;
    }

    @Column(
            name = "ID"
    )
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(
            name = "NAME"
    )
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(
            name = "ACCOUNT"
    )
    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    @Column(
            name = "DESCRIPTION"
    )
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(
            name = "ACCOUNT_ENABLE"
    )
    public String getAccountEnable() {
        return accountEnable;
    }

    public void setAccountEnable(String accountEnable) {
        this.accountEnable = accountEnable;
    }

    @Column(
            name = "ACCOUNT_LOCKED"
    )
    public String getAccountLocked() {
        return accountLocked;
    }

    public void setAccountLocked(String accountLocked) {
        this.accountLocked = accountLocked;
    }

    @Column(
            name = "ACCOUNT_LOCKED_REASON"
    )
    public String getAccountLockedReason() {
        return accountLockedReason;
    }

    public void setAccountLockedReason(String accountLockedReason) {
        this.accountLockedReason = accountLockedReason;
    }

    @Column(
            name = "SEX"
    )
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Column(
            name = "BIRTHDATE"
    )
    public Date getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Date birthdate) {
        this.birthdate = birthdate;
    }

    @Column(
            name = "CREDENTIALS_TYPE"
    )
    public String getCredentialsType() {
        return credentialsType;
    }

    public void setCredentialsType(String credentialsType) {
        this.credentialsType = credentialsType;
    }

    @Column(
            name = "CREDENTIALS_NUMBER"
    )
    public String getCredentialsNumber() {
        return credentialsNumber;
    }

    public void setCredentialsNumber(String credentialsNumber) {
        this.credentialsNumber = credentialsNumber;
    }

    @Column(
            name = "EMAIL"
    )
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(
            name = "MOBILE_TELEPHONE"
    )
    public String getMobileTelephone() {
        return mobileTelephone;
    }

    public void setMobileTelephone(String mobileTelephone) {
        this.mobileTelephone = mobileTelephone;
    }

    @Column(
            name = "OFFICE_TELEPHONE"
    )
    public String getOfficeTelephone() {
        return officeTelephone;
    }

    public void setOfficeTelephone(String officeTelephone) {
        this.officeTelephone = officeTelephone;
    }

    @Column(
            name = "FAX"
    )
    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    @Column(
            name = "CREATED_BY"
    )
    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Column(
            name = "CREATION_DATE"
    )
    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    @Column(
            name = "LAST_UPDATED_BY"
    )
    public String getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    @Column(
            name = "LAST_UPDATE_DATE"
    )
    public Date getLastUpdateDate() {
        return lastUpdateDate;
    }

    public void setLastUpdateDate(Date lastUpdateDate) {
        this.lastUpdateDate = lastUpdateDate;
    }

    @Column(
            name = "ACTIVE_FLAG"
    )
    public String getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(String activeFlag) {
        this.activeFlag = activeFlag;
    }
    @Column(
            name = "ORDER_NUM"
    )
    public Long getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Long orderNum) {
        this.orderNum = orderNum;
    }

    @OneToOne(mappedBy="upUser")
    public UpUnitUser getUpUnitUser() {
        return upUnitUser;
    }

    public void setUpUnitUser(UpUnitUser upUnitUser) {
        this.upUnitUser = upUnitUser;
    }

    @Transient
    public Long getEntityId() {
        return getNid();
    }

}
